package com.aixin.project.data;

import com.aixin.project.handler.CourseHandler;
import com.aixin.project.handler.ExpertHandler;
import com.aixin.project.handler.UserHandler;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: Sufeng
 * Date: 12-4-14
 * Time: 下午6:21
 * To change this template use File | Settings | File Templates.
 */

/**
 * 课程订单
 */
public class CourseOrder implements Serializable {
    private long id;
    private long porderid;
    private long userid;
    private long courseid;
    private long exportid;
    private int point;
    private Double price;
    private int status;  /*0,预定 1,已支付*/
    private Date createtime;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getPorderid() {
        return porderid;
    }

    public void setPorderid(long porderid) {
        this.porderid = porderid;
    }

    public long getUserid() {
        return userid;
    }

    public void setUserid(long userid) {
        this.userid = userid;
    }

    public long getCourseid() {
        return courseid;
    }

    public void setCourseid(long courseid) {
        this.courseid = courseid;
    }

    public long getExportid() {
        return exportid;
    }

    public void setExportid(long exportid) {
        this.exportid = exportid;
    }

    public int getPoint() {
        return point;
    }

    public void setPoint(int point) {
        this.point = point;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }
    
    public String showStatus(){
        return status==0?"未支付":"已支付";
    }
    
    public String showUserSchool(){
        String ret = "";
        User user = UserHandler.find(this.userid);
        if(user!=null){
            ret = user.getContactschool();
        }
        return ret;
    }

    public User getUser(){
        return UserHandler.find(this.userid);
    }
    
    public Course getCourse(){
        return CourseHandler.find(courseid);
    }
    
    public Expert getExpert(){
        return ExpertHandler.find(exportid);
    }
}
